let defaultCity = '北京'
try {
    if(localStorage.city){
        defaultCity = localStorage.city
    }
} catch (error) {
    
}
const city = {
    state: {
      city:defaultCity
    },
    mutations: {
        UPDATE_CITY: (state, city) => {
            state.city = city
            try {
                localStorage.city = city
            } catch (error) {
                
            }
        },
    },
    actions: {
        updataCity(context,city){
            context.commit("UPDATE_CITY",city)
        }
    }
}

export default city

